package com.zzyl.service;

import com.zzyl.base.PageBean;
import com.zzyl.dto.NursingProjectDto;
import com.zzyl.dto.NursingProjectPageQueryDto;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

public interface NursingProjectService {

    /**
     * 分页条件查询护理项目
     *
     * @param dto 护理项目分页条件查询Dto
     * @return {@code PageBean<NursingProjectVo> }
     * @author YiSheep
     */
    @Cacheable(cacheNames = "zzyl:nursing_project",key = "#root.methodName+':'+#dto.hashCode()")
    PageBean<NursingProjectVo> pageQuery(NursingProjectPageQueryDto dto);

    /**
     * 新增护理项目
     *
     * @param dto 护理项目分页条件查询Dto
     * @author YiSheep
     */
    @CacheEvict(cacheNames = "zzyl:nursing_project",allEntries = true)
    void addNursingProject(NursingProjectDto dto);

    /**
     * 根据id查询护理项目
     *
     * @param id 护理项目ID
     * @return {@code NursingProjectVo }
     * @author YiSheep
     */
    @Cacheable(cacheNames = "zzyl:nursing_project",key = "#root.methodName+':'+#id")
    NursingProjectVo getById(Long id);

    /**
     * 修改护理项目
     *
     * @param dto 护理项目Dto
     * @author YiSheep
     */
    @CacheEvict(cacheNames = "zzyl:nursing_project",allEntries = true)
    void updateNursingProject(NursingProjectDto dto);

    /**
     * 启用/禁用护理项目
     *
     * @param id     护理项目ID
     * @param status 状态
     * @author YiSheep
     */
    @CacheEvict(cacheNames = "zzyl:nursing_project",allEntries = true)
    void enableOrDisable(Long id, Integer status);

    /**
     * 删除护理项目
     *
     * @param id 护理项目ID
     * @author YiSheep
     */
    @CacheEvict(cacheNames = "zzyl:nursing_project",allEntries = true)
    void deleteById(Long id);

    /**
     * 查询所有护理项目
     *
     * @return {@code List<NursingProject> }
     * @author YiSheep
     */
    @Cacheable(cacheNames = "zzyl:nursing_project",key = "#root.methodName")
    List<NursingProject> getAllNursingProject();
}
